Skip to content

Commit 0912b66

Browse files
authored
Merge pull request #5535 from mozilla/MPP-4157-remove-get-relay-extension-banner
MPP-4157 Remove Get Relay Extension Banner
2 parents 3850dad + ccfe620 commit 0912b66

File tree

2 files changed

+1
-82
lines changed

2 files changed

+1
-82
lines changed

frontend/src/components/dashboard/ProfileBanners.tsx

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
} from "../../functions/getPlan";
1212
import {
1313
isUsingFirefox,
14-
supportsChromeExtension,
1514
supportsFirefoxExtension,
1615
} from "../../functions/userAgent";
1716
import { ProfileData } from "../../hooks/api/profile";
@@ -81,7 +80,7 @@ export const ProfileBanners = (props: Props) => {
8180

8281
// Don't show the "Get Firefox" banner if we have an extension available,
8382
// to avoid banner overload:
84-
if (!isUsingFirefox() && (!supportsChromeExtension() || !isLargeScreen)) {
83+
if (!isUsingFirefox() || !isLargeScreen) {
8584
banners.push(<NoFirefoxBanner key="firefox-banner" />);
8685
}
8786

@@ -100,18 +99,6 @@ export const ProfileBanners = (props: Props) => {
10099
);
101100
}
102101

103-
if (supportsChromeExtension() && isLargeScreen) {
104-
// This pushes a banner promoting the add-on - detecting the add-on
105-
// and determining whether to show it based on that is a bit slow,
106-
// so we'll just let the add-on hide it:
107-
banners.push(
108-
<NoChromeExtensionBanner
109-
profileData={props.profile}
110-
key="chrome-extension-banner"
111-
/>,
112-
);
113-
}
114-
115102
return <div className={styles["profile-banners"]}>{banners}</div>;
116103
};
117104

@@ -214,51 +201,6 @@ const NoAddonBanner = (props: NoAddonBannerProps) => {
214201
);
215202
};
216203

217-
type NoChromeExtensionBannerProps = {
218-
profileData: ProfileData;
219-
};
220-
221-
// make dismissble
222-
const NoChromeExtensionBanner = (props: NoChromeExtensionBannerProps) => {
223-
const l10n = useL10n();
224-
const gaEvent = useGaEvent();
225-
226-
return (
227-
<Banner
228-
type="promo"
229-
title={l10n.getString(
230-
"banner-download-install-chrome-extension-headline",
231-
)}
232-
illustration={{
233-
img: <Image src={AddonIllustration} alt="" width={60} height={60} />,
234-
}}
235-
cta={{
236-
target:
237-
"https://chrome.google.com/webstore/detail/firefox-relay/lknpoadjjkjcmjhbjpcljdednccbldeb?utm_source=fx-relay&utm_medium=banner&utm_campaign=install-addon",
238-
content: l10n.getString("banner-download-install-chrome-extension-cta"),
239-
size: "large",
240-
gaViewPing: {
241-
category: "Download Extension",
242-
label: "profile-banner-download-chrome-extension",
243-
},
244-
onClick: () => {
245-
gaEvent({
246-
category: "Download Firefox",
247-
action: "Engage",
248-
label: "profile-banner-download-chrome-extension",
249-
});
250-
},
251-
}}
252-
hiddenWithAddon={true}
253-
dismissal={{
254-
key: `no-chrome-extension-banner-${props.profileData.id}`,
255-
}}
256-
>
257-
<p>{l10n.getString("banner-download-install-chrome-extension-copy-2")}</p>
258-
</Banner>
259-
);
260-
};
261-
262204
type BundleBannerProps = {
263205
runtimeData: RuntimeDataWithBundleAvailable;
264206
profileData: ProfileData;

frontend/src/pages/accounts/profile.test.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -300,25 +300,6 @@ describe("The dashboard", () => {
300300
expect(firefoxBanner).toBeInTheDocument();
301301
});
302302

303-
it("shows a banner to download the Chrome extension if using a different browser that supports Chrome extensions", () => {
304-
// navigator.userAgent is read-only, so we use `Object.defineProperty`
305-
// as a workaround to be able to replace it with mock data anyway:
306-
const previousUserAgent = navigator.userAgent;
307-
Object.defineProperty(navigator, "userAgent", {
308-
value:
309-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
310-
configurable: true,
311-
});
312-
render(<Profile />);
313-
Object.defineProperty(navigator, "userAgent", { value: previousUserAgent });
314-
315-
const chromeExtensionBanner = screen.getByRole("link", {
316-
name: "l10n string: [banner-download-install-chrome-extension-cta], with vars: {}",
317-
});
318-
319-
expect(chromeExtensionBanner).toBeInTheDocument();
320-
});
321-
322303
it("shows a banner to download Firefox if using a different browser that on desktop supports Chrome extensions, but is running on a small screen and thus probably does not support extensions", () => {
323304
// navigator.userAgent is read-only, so we use `Object.defineProperty`
324305
// as a workaround to be able to replace it with mock data anyway:
@@ -333,14 +314,10 @@ describe("The dashboard", () => {
333314
setMockMinViewportWidth(true);
334315
Object.defineProperty(navigator, "userAgent", { value: previousUserAgent });
335316

336-
const chromeExtensionBanner = screen.queryByRole("link", {
337-
name: "l10n string: [banner-download-install-chrome-extension-cta], with vars: {}",
338-
});
339317
const firefoxBanner = screen.getByRole("link", {
340318
name: "l10n string: [banner-download-firefox-cta], with vars: {}",
341319
});
342320

343-
expect(chromeExtensionBanner).not.toBeInTheDocument();
344321
expect(firefoxBanner).toBeInTheDocument();
345322
});
346323

0 commit comments

Comments
 (0)